<?php
//设置面包屑
$this->breadcrumbs=array(
	'用户管理'=>array('admin'),
	'用户列表',
);
//设置页面标题
$this->pageTitle=Yii::app()->name.' - 用户列表';
$this->contentTitle='用户列表';
?>
<!-- 查询表单 -->
<?php $this->renderPartial('_search',array(
            'model'=>$model,
)); ?>
<!-- 查询表单 -->
<table cellspacing="1" class="mylist2">
          <thead>
          <tr class="mylist_title">
            <td width="3%"><input type="checkbox" class="checkbox" onclick="InverSelect();" /></td>
            <td><?php echo $model->getAttributeLabel('id');?></td>
            <td>用户名</td>
            <td>用户密码</td>
            <td width="160" align="center">操 作</td>
          </tr>
          </thead>
          <tbody>	
          <?php foreach ($data->getData() as $key => $value) {?>
          <tr class="datalist">
              <td align="center"><input name="id[]" type="checkbox" value="<?php echo CHtml::encode($value->id) ?>" class="checkbox" /></td>
              <td><?php echo CHtml::encode($value->id) ?></td>
            <td><?php echo CHtml::encode($value->username) ?></td>
            <td><?php echo CHtml::encode($value->password) ?></td>
            <td align="center" class="action">
                <?php echo CHtml::link('查看', array('user/view','id'=>$value->id)); ?>
                <?php echo CHtml::link('修改', array('user/update','id'=>$value->id)); ?>
                <?php echo CHtml::link('删除', 'javascript:deleteSelect('.$value->id.');') ?>
            </td>
          </tr>
          <?php }?>
          </tbody>
</table>

<div class="mylist_foot">
    <div class="fl p10 btn"><a href="javascript:deleteSelect(0);">批 量 删 除</a></div>
    <div class="fl p10 btn"><?php echo CHtml::link('添 加', array('user/create')); ?></div>

          <div class="pagecss fr">
          <?php $this->widget("CLinkPager", array(
                "pages" => $data->pagination,
                "header"=>"跳转到：",
                "prevPageLabel"=>"&lt; 上一页",
                "nextPageLabel"=>"&gt; 下一页",
                "firstPageLabel"=>"&lt;&lt; 首页",
                "lastPageLabel"=>"&gt;&gt; 尾页",
                "maxButtonCount"=>10,
                "footer"=>"当前页数：".$data->pagination->currentPage." 总页数：".$data->pagination->pageCount." 总记录数：".$data->pagination->itemCount
            )) ?>
          </div>
        </div>
<script type="text/javascript">
    function deleteSelect(id){
        ajaxSubmitdeleteSelect(id,'<?php echo Yii::app()->createUrl('user/delete',array('id'=>0)) ?>');
    }
</script>
